<template>
	<view class="container">
		<view class="list">
			<view @click="show(index,item)" class="item" v-for="(item,index) in teamList" :key="index">
				<view class="left">
					<image :src="followLogo"></image>
				</view>
				<view class="center">
					<view class="title">{{item.name}}</view>
					<!-- <view class="tag" v-if="index==0" :class="{'tag':index==0}">智汇生活</view>
					<view class="tag" v-if="index==1" :class="{'tag2':index==1}">智汇工程</view>
					<view class="tag" v-if="index==2" :class="{'tag3':index==2}">智汇教育</view>
					<view class="tag" v-if="index==3" :class="{'tag4':index==3}">法律服务</view>
					<view class="tag" v-if="index==4" :class="{'tag':index==4}">智汇生活</view> -->

					<!-- <view class="tag" v-else :class="{'tag2':index>=3}">智汇工程</view> -->
				</view>
				<view class="right">
					<!-- <view class="btn">取消关注</view> -->
					<image v-if="index == current" class="picture" src="../../static/register/xz.png" mode=""></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				followLogo: this.$mAssetsPath.companyLogo,
				current:-1,
				teamList:[],
			}
		},
		onLoad(options){
			this.initPage();
		},
		methods: {
			show(index,item){
				this.current = index; 
				let query = encodeURIComponent(JSON.stringify(item))
				uni.navigateTo({
					url:"/pages/release/engineeringInformation?data="+query
				})
			},
			async initPage(){
				let result = await this.$apis.iAmTeam();
				this.teamList = result.data;
				if(this.teamList.length == 0){
					uni.showToast({
						title: "请先创建团队",
						icon: 'none'
					});
					setTimeout(() => {
						this.$mRouter.back();
					},1000)
				}
			},
		}
	}
</script>

<style scoped lang="scss">
	page {
		background-color: #f4f4f4;
	}

	.container {
		.list {
			.item {
				border-bottom: #f4f4f4 solid 1upx;
				height: 154upx;
				width: 100%;
				background-color: #fff;
				display: flex;
				align-items: center;
				padding: 0 24upx;
				justify-content: space-between;

				.center {
					flex: 1;
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					height: 100%;
					padding: 32upx 24upx;

					.title {
						color: #0E1E36;
						font-size: 30upx;
						font-weight: 500;
					}

					.tag {
						color: #5793FC;
						border: #5793FC solid 1upx;
						border-radius: 4px;
						width: fit-content;
						width: -webkit-fit-content;
						width: -moz-fit-content;
						padding: 5upx 12upx;
						font-size: 24upx;
						line-height: 24upx;
					}

					.tag2 {
						color: #03C49C;
						border: #03C49C solid 1upx;
					}

					.tag3 {


						color: #FF9D57;
						border: #FF9D57 solid 1upx;
					}

					.tag4 {

						color: #FFCF41;
						border: #FFCF41 solid 1upx;
					}
				}

				.right {
					.btn {
						width: 153upx;
						height: 58upx;
						border: #AB62FF solid 2upx;
						color: #AB62FF;
						border-radius: 29upx;
						text-align: center;
						line-height: 58upx;
					}
				}

				.left {
					image {
						width: 102upx;
						height: 118upx;
					}
				}

				.picture {
					width: 44rpx;
					height: 44rpx;
					border: 1px dashed #AB61FF;
				}
			}
		}
	}
</style>
